﻿using NoIdeaIoc;

namespace NoIdeaWebApi.Dtos;

public class TestIoc : IDisposable
{
    readonly ILogger logger;
    readonly string name;
    readonly string sex;
    readonly int age;
    readonly System.DateTime time;
    readonly IHttpClientFactory httpClientFactory;
    public TestIoc([IocKey("e")] string name, [IocKey("b")] int age, [IocKey("c")] System.DateTime dateTime, [IocKey("s")] string sex, IHttpClientFactory httpClientFactory, ILogger logger)
    {
        this.name = name;
        this.sex = sex;
        this.age = age;
        this.time = dateTime;
        this.httpClientFactory = httpClientFactory;
        this.logger = logger;
    }
    public string Name => name;
    public string Sex => sex;
    public int Age => age;
    public DateTime Time => time;
    public bool IsHttpNull => httpClientFactory == null;
    readonly Guid guid = Guid.NewGuid();
    public void Dispose()
    {
        logger.LogInformation($"TestIoc=>{guid.ToString("N")}=>已释放......");
    }
}